import { service as request } from '@/utils/request'

/**
 * 机房视图
 * @param {data} name 
 * @param {type} type  视图类型,0表示机房视图，1表示业务视图
 * @returns 
 */
export function getList (data) {
  return request({
    url: `/hawk/businessview/search/${data.query.type}`,
    method: 'get',
    params: data.query
  })
}
/**
 * 根据id查询视图
 * @param {*} id 
 * @returns 
 */
export function ciInfo (id) {
  return request({
    url: `/hawk/businessview/get/${id}`,
    method: 'get'
  })
}

/**
 * 根据 ID 删除视图
 * @param {*} id 
 * @returns 
 */
export function deleteCI (id) {
  return request({
    url: `/hawk/businessview/del/${id}`,
    method: 'delete'
  })
}



/**
 * 添加视图
 * @param {*} data 
 * @returns 
 */
export function doAdd (data) {
  return request({
    url: `/hawk/businessview/save`,
    method: 'post',
    data
  })
}
/**
 * 更新视图
 * @param {*} data 
 * @returns 
 */
export function doEdit (data) {
  return request({
    url: `/hawk/businessview/update`,
    method: 'put',
    data
  })
}
export function deleteRelation (id) {
  return request({
    url: `/assets/ci/relation/${id}`,
    method: 'delete'
  })
}


export function deleteNode (id) {
  return request({
    url: `/assets/ci/node/${id}`,
    method: 'delete'
  })
}